{% extends "_layouts/index.html" -%}

{% block search -%}
{{ search::input(name="name", title="名称", value=name)}}
{{ search::input(name="remark", title="备注", value=remark)}}
{{ search::list(name="page_id", title="页面", data=pages, value=page_id)}}
{{ search::list(name="position_id", title="位置", data=positions, value=position_id)}}
{{ search::yes_no(name="is_blank", title="是否外链", value=is_blank)}}
{% endblock search -%}

{% block options -%}
{{option::delete_all()}} {{option::add(height=400)}} 
{% endblock options -%}

{% block content -%}
<table class="layui-table layui-form">
<thead>
    <tr>
        <th style="width: 40px"> <input type="checkbox" name=""  lay-skin="primary"> </th>
        <th class="row-id">编号</th>
        <th>名称</th>
        <th>备注</th>
        <th>图片</th>
        <th>页面</th>
        <th>位置</th>
        <th>链接地址</th>
        <th>是否外链</th>
        <th>排序</th>
        <th>操作</th>
    </tr>
    <tbody>
    {% for r in records -%}
    <tr>
        <td> <input type="checkbox" name=""  lay-skin="primary"> </td>
        <td>{{r.id}}</td>
        <td>{{r.name}}</td>
        <td>{{r.remark}}</td>
        <td>{{r.image}}</td>
        <td>{%if r.page_id == 0%}网站首页{%else%}详情页面{%endif%}</td>
        <td>{{r.position_id|position_name}}</td>
        <td>{{r.url}}</td>
        <td>{{r.is_blank|yes_no}}</td>
        <td>{{r.seq}}</td>
        <td class="td-manage"> {{option::update(id=r.id, height=300)}} | {{option::delete(id=r.id)}} </td>
    </tr>
    {% endfor -%}
    </tbody>
</thead>
</table>
{% endblock content -%}
